#include <iostream>
#include <queue>
#include <cstring>
#include <algorithm>
using namespace std;
constexpr int MAXN = 12;
bool used[MAXN];
int N, T, Num[MAXN];
// 递归时候的字典序
void solve();
int main() {
    cin >> N >> T;
    solve();
}

int calculate() {
    int nums[MAXN];
    memcpy(nums, Num, sizeof Num);
    for (int i = N; i > 0; i--) {
        for (int j = 0; j < i - 1; j++) {
            nums[j] = nums[j] + nums[j + 1];
        }   
    }
    return nums[0];
}

bool flag = false;
void permulate(int n) {
    if (flag) return;
    if (n == N) {
        if (calculate() == T) flag = true;
        return;
    }
    for (int i = 1; i <= 10; i++) {
        if (flag) return;
        if (!used[i]) {
            Num[n] = i;
            used[i] = true;
            permulate(n + 1);
            used[i] = false;
        }
    }
}

void solve() {
    permulate(0);
    for (int i = 0; i < N; i++)
        cout << Num[i] << " ";
    cout << endl;
}